Skip to main content

multiply

Type

command

Summary

Multiplies a number by a container and places the resulting value in the container.

Syntax

multiply [<chunk> of] <container> by <number>
multiply <arrayContainer> by {<number> | <array>}

Description

Use the multiply command to multiply a container or a portion of a container by a number, or to multiply two arrays containing numbers.

The contents of the container (or the chunk of the container) must be a number or an expression that evaluates to a number.

If an arrayContainer is multiplied by a number, each element is multiplied by the number. If an arrayContainer is multiplied by an array, both arrays must have the same number of elements and the same dimension, and each element in the arrayContainer is multiplied by the corresponding element of the array.

If the container or an element of the arrayContainer is empty, the multiply command treats its contents as zero.

If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information.

Parameters

NameTypeDescription

chunk

A chunk expression specifying a portion of the container.

container

A field, button, or variable, or the message box.

number

Any expression that evaluates to a number.

arrayContainer

array

An array variable each of whose elements is a number.

array

array

Examples

multiply field 17 by it
multiply yearlyTotals by yearlyPercentages
multiply line thisLine of myVariable by theFactor

command: add, divide, subtract

function: format, value, matrixMultiply

glossary: property, element, container, expression, array, evaluate, command, math operation

keyword: field, element, button

operator: asterisk

property: numberFormat

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?